import request from '@/utils/request'

export function getList(params) {
  return request({
    url: '/sales/list',
    method: 'get',
    params
  })
}

export function getTask(params) {
  return request({
    url: '/sales/task',
    method: 'get',
    params
  })
}

export function create(data) {
  return request({
    url: '/sales/create',
    method: 'post',
    data
  })
}

export function remove(data) {
  return request({
    url: '/sales/remove',
    method: 'post',
    data
  })
}

export function updatePassword(data) {
  return request({
    url: '/sales/updatePassword',
    method: 'post',
    data
  })
}

export function findById(params) {
  return request({
    url: '/sales/findById',
    method: 'get',
    params
  })
}

export function update(data) {
  return request({
    url: '/sales/update',
    method: 'post',
    data
  })
}

export function getUpRoleList() {
  return request({
    url: '/salesRole/upList',
    method: 'get',
  })
}

export function getRoleList() {
  return request({
    url: '/salesRole/list',
    method: 'get',
  })
}

export function getAllRoleList() {
  return request({
    url: '/salesRole/allList',
    method: 'get',
  })
}

export function createOrEditRole(data) {
  return request({
    url: '/salesRole/createOrEdit',
    method: 'post',
    data
  })
}

export function deleteSalesRole(data) {
  return request({
    url: '/salesRole/delete',
    method: 'post',
    data
  })
}

export function EditSales(data) {
  return request({
    url: '/sales/leave',
    method: 'post',
    data
  })

}
